package ch.zhaw.cctd.domain.player;

import java.awt.Point;
import java.io.Serializable;

import ch.zhaw.cctd.domain.map.WayPoint;

/**
 * Ein SpawnPoint ist ein erweiterter Waypoint. Er gehört einem Spieler und ist
 * nur aktiv solang dieser Spieler aktiv ist.
 * 
 * @author Rolf
 * 
 */
public class SpawnPoint extends WayPoint implements Serializable {

	/**
	 * Serializable ID
	 */
	private static final long serialVersionUID = 7067946193638713960L;

	// Owner
	private Player owner;

	/**
	 * Constructor with support for targetWayPoint already included
	 * 
	 * @param id
	 * @param owner
	 * @param position
	 * @param nextWayPointId
	 * @param targetPoint
	 */
	public SpawnPoint(String id, Player owner, Point position, String nextWayPointId, WayPoint targetPoint) {
		super(id, position, nextWayPointId, targetPoint);
		setOwner(owner);
	}

	/**
	 * Default Constructur (Requires to call settargetWayPoint of the WayPoint
	 * Superclass)
	 * 
	 * @param id
	 * @param owner
	 * @param position
	 * @param nextWayPointId
	 */
	public SpawnPoint(String id, Player owner, Point position, String nextWayPointId) {
		super(id, position, nextWayPointId);
		setOwner(owner);
	}

	/**
	 * Get Owner
	 * 
	 * @return owner
	 */
	public Player getOwner() {
		return owner;
	}

	/**
	 * Set Owner
	 * 
	 * @param owner
	 */
	private void setOwner(Player owner) {
		this.owner = owner;
	}

}
